﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1.segments.data_type
{
    class CM_EIP
    {
        public StringBuilder Parent_s_Placer_Order_Number { get; set; }
        public StringBuilder Parent_s_Filler_Order_Number { get; set; }

        public int fill(string source, int temp)
        {
            int i, x = 0;
            for (i = temp; i < source.Length; i++)
            {
                if (source[i] == '^')
                    x++;
                else if (source[i] == '|')
                {
                    Parent_s_Placer_Order_Number.Capacity = Parent_s_Placer_Order_Number.Length;
                    Parent_s_Filler_Order_Number.Capacity = Parent_s_Filler_Order_Number.Length;
                    return i;
                }

                else if (x == 0)
                {
                    if (Parent_s_Placer_Order_Number == null)
                        Parent_s_Placer_Order_Number = new StringBuilder();
                    Parent_s_Placer_Order_Number.Insert(Parent_s_Placer_Order_Number.Length, source[i]);
                }
                else if (x == 1)
                {
                    if (Parent_s_Filler_Order_Number == null)
                        Parent_s_Filler_Order_Number = new StringBuilder();
                    Parent_s_Filler_Order_Number.Insert(Parent_s_Filler_Order_Number.Length, source[i]);
                }
            }
            return i;
        }
    }
}
